#ifndef MJUI_H
#define MJUI_H

#include <QWidget>

#include <QMouseEvent>
#include <QPaintEvent>
#include <QKeyEvent>
#include <QPoint>
#include <QPixmap>
#include <QTimerEvent>

#include "MJStone.h"
namespace Ui {
class MJUI;
}

class MJUI : public QWidget
{
    Q_OBJECT

public:
    explicit MJUI(QWidget *parent = 0);
    ~MJUI();
    void paintEvent(QPaintEvent *event) override;

    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;


    void keyPressEvent(QKeyEvent *event) override;

    void timerEvent(QTimerEvent *event) override;

private:
    Ui::MJUI *ui;

    vector<QPixmap>  drawAllStone;


    QPoint clickPosition;
    QPoint releasePosition;
    QPoint tempPosition;

    int selectTopMJ;
    int selectHandMJ;
};

#endif // MJUI_H
